import { useState, useEffect, useLayoutEffect } from "react";
const App = (prpos) => {
  const [count, setCount] = useState(0);
  useLayoutEffect(() => {
    debugger;
    console.log("执行useLayoutEffect");
    return () => {
      console.log("useLayoutEffect销毁函数执行啦");
    };
  }, [count]);
  useEffect(() => {
    console.log("执行useEffect", count);
    return () => {
      console.log("useEffect销毁函数执行啦");
    };
  }, [count]);

  return (
    <div>
      <h1 onClick={() => setCount(count + 1)}>{count}</h1>
    </div>
  );
};

export default App;
